UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'v1jy5fO8ddd1C/Df4ftwYsioYDUAn7l0kgMgMqC0O5A=' 
WHERE 
  key_id = '5d89ad6fc8bb5a88d2ac62eb79ab0def6a9d2962d3e313e3f927a85d17a6cad7' 
  AND (
    token = 'v1jy5fO8ddd1C/Df4ftwYsioYDUAn7l0kgMgMqC0O5A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027