UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hMOfLrhXbf+vhm+drWchZcULfoB7cUIKBVo1KrS5VpQ='
WHERE
key_id = '0155196752ab54bdfb068c44dfcd24b14a212fe99a82b7113d054290baf50c6e'
AND (
token = 'hMOfLrhXbf+vhm+drWchZcULfoB7cUIKBVo1KrS5VpQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)