UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'z0JNajB21AOxpHEDhZvky85QG5UcMs/p/34WZJEXJjU='
WHERE
key_id = '83afc6157d23188f6e1fd5c03267c06b6b12bd246dc4a0ab4af0c32cfc8a1509'
AND (
token = 'z0JNajB21AOxpHEDhZvky85QG5UcMs/p/34WZJEXJjU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)