UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NkWVg+6/cU6P+KxUzrLnf4iLrRwZXMyYbZG9zjPulGE='
WHERE
key_id = '5e6f7f23cc7741550ef3453c2a4989f2cf5cab077ef47288e4ccf8c6123c8d13'
AND (
token = 'NkWVg+6/cU6P+KxUzrLnf4iLrRwZXMyYbZG9zjPulGE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)