UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iZ0/HZfSSBEUNRZ6KukzxbvlfFZZz8k6CpvuIwPOagA='
WHERE
key_id = '230d5fa4a9755ee327eff88bfa3c0f62ea0c0c71140952f34b5de12256fab227'
AND (
token = 'iZ0/HZfSSBEUNRZ6KukzxbvlfFZZz8k6CpvuIwPOagA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)