UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/Kh1P7uFJ4Wo7OiRf2POXGyKWwn1RziGuJdzxREsrYw='
WHERE
key_id = '1e4ce1294b051c376056842666544afcd5acbfb33db91a21fe7da1212f06dbcb'
AND (
token = '/Kh1P7uFJ4Wo7OiRf2POXGyKWwn1RziGuJdzxREsrYw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)