UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CkUTAo7BSscBJq4erWrdSZll7kwVspKM+TP8OA/89W4='
WHERE
key_id = '292ae91981efd25c2088caa6f12e387baed010042b643e2ed72e6641af869e12'
AND (
token = 'CkUTAo7BSscBJq4erWrdSZll7kwVspKM+TP8OA/89W4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)