UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sFJKnhR9IWDKKH8gzYc44SIKwG7pQOg4jBKD9AXVM+4='
WHERE
key_id = 'ee06457cc826e154d4bb9a42ac2ccf3e50d75ce66a8cbfd12f850c84308eb5f1'
AND (
token = 'sFJKnhR9IWDKKH8gzYc44SIKwG7pQOg4jBKD9AXVM+4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)