UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XqGE/BHLoZeJVwKwTf7IutFuq+Gog+q8FOWLHVDInBM='
WHERE
key_id = '55bf8e6ae526615390effe574863ee13f5d82618530bff412bbe33613b7f0b3f'
AND (
token = 'XqGE/BHLoZeJVwKwTf7IutFuq+Gog+q8FOWLHVDInBM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)