UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FGLP3f+NW/6AjG7spYVXUIJerN9JNrargWmu6qbzzOQ='
WHERE
key_id = '4f452cfe944875e5eb7eb00e3a304f7f171e9889378db43b4a79e7e1be48414a'
AND (
token = 'FGLP3f+NW/6AjG7spYVXUIJerN9JNrargWmu6qbzzOQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)