UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'poD8soFuQpL5TXhnOgncH5bfkIkKm7Rx+cQ5q+i5yyk='
WHERE
key_id = 'ddc402eaa039aad792965bbaae79ff411e910ca4debac2299dd41fbfaaaac69a'
AND (
token = 'poD8soFuQpL5TXhnOgncH5bfkIkKm7Rx+cQ5q+i5yyk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)