UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kyV5ZXOb4RSsb+zV100pSfQUOZF4kD0kJWKq4AtMUd0='
WHERE
key_id = 'b2c0cd58c8e0abead589be361a957b530e8ce333b9110ac69d02dd095fc5c87f'
AND (
token = 'kyV5ZXOb4RSsb+zV100pSfQUOZF4kD0kJWKq4AtMUd0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)