UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gkrHVfpc/wh6FrjV+yFTEMlJAQtpjVADK805BMn2JqI='
WHERE
key_id = 'db0b6e2bb78213982b7d78701c69942b67ecd35026330a0faf4a71ffc2ed5742'
AND (
token = 'gkrHVfpc/wh6FrjV+yFTEMlJAQtpjVADK805BMn2JqI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)