UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'A5VrbtYh41fCknGTFEZi3lqKiYNgiOPfqcT/0uMHRbM='
WHERE
key_id = 'f6abfd1e24d6810f6560a20dbf147f7fd42f17cc0bb3359b92810d773c838408'
AND (
token = 'A5VrbtYh41fCknGTFEZi3lqKiYNgiOPfqcT/0uMHRbM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)