UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IZRIW7FA+FeJWZFW0mvLnB1iaM3AA7bU1KjN3fBAMqk='
WHERE
key_id = 'eb789012733006cff7025a01d3cf8895826bc394dc1ef6a5546afc621361f60d'
AND (
token = 'IZRIW7FA+FeJWZFW0mvLnB1iaM3AA7bU1KjN3fBAMqk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)