UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zvz5u6P0f9wFQLejYFE6ROg6okyWz9NTW27O2bCL0/M='
WHERE
key_id = '310c99d29adbcf7939d1de43093d3dd6c390c86ac41d74c3ffef9cb1bc962fa8'
AND (
token = 'zvz5u6P0f9wFQLejYFE6ROg6okyWz9NTW27O2bCL0/M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)