UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'D8a+al8ausT6ckT6yvZaB8liSK5ES86TT65Ptv6aKwU='
WHERE
key_id = '24aa67ebae44ab5f54eb079cabe698060e734dd7dfdaf9d6510c52bd4e66dbfc'
AND (
token = 'D8a+al8ausT6ckT6yvZaB8liSK5ES86TT65Ptv6aKwU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)