UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'k5mnfUO4Ds/PuF7XaJlQuZ7nY0qB7R+rfx/pjRL4Lno=' 
WHERE 
  key_id = 'cb8f9a060ecfe28ad336216515794eef7ab7100d9ecac26b5b68e9b04a50fe38' 
  AND (
    token = 'k5mnfUO4Ds/PuF7XaJlQuZ7nY0qB7R+rfx/pjRL4Lno=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016