UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '59jhu92GyLLJa57pgMq50NyC8DD3bsqoPBZjTQzGK6A=' 
WHERE 
  key_id = 'aa067a4c3a04a04a24a1420f95881b465b69f60f3d050ef9910c3d1baf898a0b' 
  AND (
    token = '59jhu92GyLLJa57pgMq50NyC8DD3bsqoPBZjTQzGK6A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018