UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'po+NSpuIwNaTovVfRcutIDGpOP6/rEFkKUQp94+erMg=' 
WHERE 
  key_id = '777d8d61b1fac60e1d656f9c7a1ad2b42cc3bcfa640688bb994c4ff63ba0644a' 
  AND (
    token = 'po+NSpuIwNaTovVfRcutIDGpOP6/rEFkKUQp94+erMg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014