UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+pErTYWFDntSaR3OJYyasOHrfmTpf0Se/ovSNTnjc/w='
WHERE
key_id = 'f66e429892f68026c45d8ae21475ae2a513e21ab7033667b75881819995189a8'
AND (
token = '+pErTYWFDntSaR3OJYyasOHrfmTpf0Se/ovSNTnjc/w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)