UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NgJVMSpXFFJGestK8kQsnDjnwiykXfXe36Q/CNuZhxk='
WHERE
key_id = 'a0993bb33c7e22c76c79d877ab0b96a7be0da3be99c45842092ba9a4498986ec'
AND (
token = 'NgJVMSpXFFJGestK8kQsnDjnwiykXfXe36Q/CNuZhxk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)