UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '56kTP36id15RzYNKKonPWF9X0v5gwh0kgHs40n7IUmM=' 
WHERE 
  key_id = 'e13bd5f808bdded41f46ca356ff700b8b671ca534992fd223f1c7a6495b4de86' 
  AND (
    token = '56kTP36id15RzYNKKonPWF9X0v5gwh0kgHs40n7IUmM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027