UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NogL9y9Qil9TvavQu+ft4DkiEVdpmmUg1qcQNQAZVQM=' 
WHERE 
  key_id = '5d2598f90e2b35842546821110bb9c49b6bd31d99c99075e5ef41db72dde050b' 
  AND (
    token = 'NogL9y9Qil9TvavQu+ft4DkiEVdpmmUg1qcQNQAZVQM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026