UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'k5ynWCV7CukQS6FVAMqEXYPlSw1IQxJPG0LIWn27RNs='
WHERE
key_id = '85592039f83418390be14c4fe2fa499c2d9597ba9871f8d29ef4e9afa7be78f2'
AND (
token = 'k5ynWCV7CukQS6FVAMqEXYPlSw1IQxJPG0LIWn27RNs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)