UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'q/PgGSc7pIEJJf+ZqGMkp/o3YJgXy/D97pb9XmAKmn0='
WHERE
key_id = '8a62520dac71e3677e2bafd046d461c6fdef613957b2f8ac5a4121175a30015d'
AND (
token = 'q/PgGSc7pIEJJf+ZqGMkp/o3YJgXy/D97pb9XmAKmn0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)