UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JdbesMOC2UIpeMQHnhb1d8B+D2MH10orKSDyxaa0YQE='
WHERE
key_id = 'bde296c7f71d4164c7cd52fb2389aa063ea09531623a2953aeff73b693e3bc28'
AND (
token = 'JdbesMOC2UIpeMQHnhb1d8B+D2MH10orKSDyxaa0YQE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)