UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/0zL6duxLhKeKslRkEA53TJS9w/DXvz+hRdkpaGWDzY=' 
WHERE 
  key_id = 'cca3bf7d523118369df34f0515e6b54e5968a4a0dbac6b389d2f072bf187b6fe' 
  AND (
    token = '/0zL6duxLhKeKslRkEA53TJS9w/DXvz+hRdkpaGWDzY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038