UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WdME+0uGtvPkza6zYIMBXxqDONnNqxiNKpaLss7jm4M='
WHERE
key_id = '56296ff20af509dcd24d95dbc6b72121288b3a6864a32899304640301c9b5442'
AND (
token = 'WdME+0uGtvPkza6zYIMBXxqDONnNqxiNKpaLss7jm4M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)