UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3sCRikgu8P3hBRlEf9D7vH+hHen6woHoUTvy7b5Rf4U=' 
WHERE 
  key_id = 'bae0728b7f0dce53b75b2a25a0b6d1afc201d0c16b46da97929a92b1f14c8c54' 
  AND (
    token = '3sCRikgu8P3hBRlEf9D7vH+hHen6woHoUTvy7b5Rf4U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029