UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JpmG5bsX/P1XRrDMRD4dZwNGCFe1D9XC3M2ioGgJ0Vk='
WHERE
key_id = 'ffb1e7885d522320df28ee3952cd84d8cfaaaf912b4bccbc1450208523b040f5'
AND (
token = 'JpmG5bsX/P1XRrDMRD4dZwNGCFe1D9XC3M2ioGgJ0Vk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)