UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mBkdV+hiZQ/WeQLEma8aBkPeB4kNuRLQPMcOpzOkNXI=' 
WHERE 
  key_id = '1ed32992a3d18ae90e01b9d455896fa47d31f3266cde34ce6df7ff5c39453b8e' 
  AND (
    token = 'mBkdV+hiZQ/WeQLEma8aBkPeB4kNuRLQPMcOpzOkNXI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041