UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eoibiuRBzcgVnhIzIiiAjvbAeHt+7iFFPULvqDo6FNI=' 
WHERE 
  key_id = '6794e13f710b28a7a52b2687bf1621ee7b4e1d74ec3e8f787b50425d9c98ece5' 
  AND (
    token = 'eoibiuRBzcgVnhIzIiiAjvbAeHt+7iFFPULvqDo6FNI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031