UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gLbfQJmQzefntShSsQB/+PPJQt+4zwtsptzDl161zew='
WHERE
key_id = 'ac229d724acb5ad8617967f7c1be8b02f1d31efb34e7b51c079355e288b630f7'
AND (
token = 'gLbfQJmQzefntShSsQB/+PPJQt+4zwtsptzDl161zew='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)