UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eARbaJLtJBL0IsiUijn+C3Ovo/2Jkh7nts1HNM8yMZo=' 
WHERE 
  key_id = '1a0fc7ae87b46be23e458a86898df88cbaad116f1570a0b1c3cbef183c7db5d9' 
  AND (
    token = 'eARbaJLtJBL0IsiUijn+C3Ovo/2Jkh7nts1HNM8yMZo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031