UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ijbTa+TZAmXtWMjSkRnO5SpOv+ut1iqMATNZUw9z5LI=' 
WHERE 
  key_id = '096c7f3522c31c49e8e446e0dd28b137be3fa4fb0bf1edcf697cf525b0597f88' 
  AND (
    token = 'ijbTa+TZAmXtWMjSkRnO5SpOv+ut1iqMATNZUw9z5LI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026