UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WSkqPFufmIwt/WuGF5ER3eL2edtOuio9byPBLqVlhHk=' 
WHERE 
  key_id = '49f8ad08dcc643c0107f8eeb808711652fafb88390c5dd52a58685b4d2312280' 
  AND (
    token = 'WSkqPFufmIwt/WuGF5ER3eL2edtOuio9byPBLqVlhHk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055