UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sgargeD8VJthS42DHfIslDTBvfMYkAX3TLgFaH5azVg='
WHERE
key_id = '73c74c0e51ab1a93305fe0c60e87d5cfd1ffef4e78bffb3e26d5ed42b571af5a'
AND (
token = 'sgargeD8VJthS42DHfIslDTBvfMYkAX3TLgFaH5azVg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)