UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HlQ9fsBX3dgPv5pZQR3kvksWGF8urULe0DP1FMe/sTU='
WHERE
key_id = 'f5c4e7edc45f3c515b11869486283ecd441b418ed6e338c6558cdd07dfba3225'
AND (
token = 'HlQ9fsBX3dgPv5pZQR3kvksWGF8urULe0DP1FMe/sTU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)