UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FM7+tR8JJDe3dQa3pZU0sY7rI9CxxQszRgzrh5VCPUk=' 
WHERE 
  key_id = 'fe678ade8c7b575fe8f153c29d7c92834745eb602247f1b2a29cf4d0b9f1fa17' 
  AND (
    token = 'FM7+tR8JJDe3dQa3pZU0sY7rI9CxxQszRgzrh5VCPUk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030