UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 't7X3iKH2MsXqrERjP1/e4MJoMM7+DhVnfR0hcZr+Yuw='
WHERE
key_id = '83216fd30d32623e3d04759ae64c342f25362b08271af988a631b433ed4bcfa9'
AND (
token = 't7X3iKH2MsXqrERjP1/e4MJoMM7+DhVnfR0hcZr+Yuw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)