UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'r/ldi7YmQxAqvw7Y94nyIr2E04e0RiTR4nOXCB/sgDk='
WHERE
key_id = 'c1be9d2cf894d55f50038b87933f8f1d3043697dec333e58079276069ad05d20'
AND (
token = 'r/ldi7YmQxAqvw7Y94nyIr2E04e0RiTR4nOXCB/sgDk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)