UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NWRxPSxi/JAkF5O7icexJUaJiZIOQtgjivE6MOry5Lg='
WHERE
key_id = '7fdde663d005e4fa00c5afeb0494d43173a7aa1964750248ce4f768e48f7bc7a'
AND (
token = 'NWRxPSxi/JAkF5O7icexJUaJiZIOQtgjivE6MOry5Lg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)