UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OJ1TEToJFjPi5BkfTZh39D/k5t6hdqFFzjvqmDNIE8Y='
WHERE
key_id = 'cf16100e78432b32a650210642ec8c1a7fe2792217cc4ed714c6d949b1ea49d2'
AND (
token = 'OJ1TEToJFjPi5BkfTZh39D/k5t6hdqFFzjvqmDNIE8Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)