UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8uM4LsErZex+366LhHX5COxO+zaNkNzQVglWOLaBrGg='
WHERE
key_id = 'a91e4b556de66c853dbb28ab8914bd77a7fcd2354071b94c4383c38c4d99e9d0'
AND (
token = '8uM4LsErZex+366LhHX5COxO+zaNkNzQVglWOLaBrGg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)