UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YANmQO40oH6Zpl/pOiMLMaTNHhB8FKusS0E1UGhrueY='
WHERE
key_id = 'b00979ed2ec5738afa118533c7b8b7076b79e086ae9b94f6e5bb6a28afae630d'
AND (
token = 'YANmQO40oH6Zpl/pOiMLMaTNHhB8FKusS0E1UGhrueY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)