UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'F48Eqn3zM4VtLuajhh7q2ZzG/4dhNsyuBgEZ+j33Xzg='
WHERE
key_id = '8c8b6d5998ec3b8cb1eb29794a0b939142f8f135ada2041153875a386d9d66cc'
AND (
token = 'F48Eqn3zM4VtLuajhh7q2ZzG/4dhNsyuBgEZ+j33Xzg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)