UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'q6dz+eQ0+zLoqCE/oUjOhsMUNFEBpn3NjWw45VxJM6M='
WHERE
key_id = 'ffb58dfc176b0b8426207c190e7ad62dcc7265405b74c2628dd90fdf336c94ab'
AND (
token = 'q6dz+eQ0+zLoqCE/oUjOhsMUNFEBpn3NjWw45VxJM6M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)